<?php

// $Id$

require_once('tcms_vpage_template_dbc.class.php');
require_once('tcms_vpage_dbc.class.php');
require_once('tcms_vpage_deleter.class.php');
require_once('tcms_vpt_system_attribute_dbc.class.php');


class TCMS_VPage_Template_Deleter extends Tangra_Class {
	public static function delete(DB_Connection $dbc, $vpage_template_id, $hidden_inc_path) {
		TCMS_VPage_Template_DBC::delete($dbc, $vpage_template_id);

		$vpages_ids = TCMS_VPage_DBC::load_all_vpage_ids_for_template($dbc, $vpage_template_id);
		foreach($vpages_ids as $vpage_id) {
			TCMS_VPage_Deleter::delete($dbc, $vpage_id, $hidden_inc_path);
		}

//TODO - delete sas and cis

	}
}